local shexin = fk.CreateSkill {
  name = "emo__shexin",
  tags = {Skill.Compulsory},
}

shexin:addEffect(fk.PreDamage, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(shexin.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if data.to == player then data:preventDamage() end
    local transfer = data.to.chained and data.damageType ~= fk.NormalDamage
    room:loseHp(data.to, data.damage, shexin.name)
    if transfer then
      for _, p in ipairs(room:getOtherPlayers(player)) do
        if p ~= data.to and p.chained and not p.dead then
          room:loseHp(p, data.damage, shexin.name)
        end
      end
    end
    data:preventDamage()
  end,
})


Fk:loadTranslationTable{
  ["emo__shexin"] = "蛇心",
  [":emo__shexin"] = "锁定技，防止你对自己造成伤害。你对其他角色造成的伤害改为令其流失等量的体力，若是属性伤害且其已横置，令除其外所有横置的其他角色依次失去等量体力。",
}

return shexin
